package tile.mapeditor.widget;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JButton;

public class ColorButton extends JButton implements ActionListener
{
    public ColorButton(Color initialColor)
    {
        setBackground(initialColor);
        addActionListener(this);
    }

    public ColorButton()
    {
        this(Color.white);
    }

    public Dimension getPreferredSize()
    {
        return new Dimension(40, 15);
    }

    public void setColor(Color color)
    {
        setBackground(color);
    }

    public Color getColor()
    {
        return getBackground();
    }

    public void actionPerformed(ActionEvent event)
    {
    }
}
